import java.util.Scanner;
import java.util.Stack;

public class Main {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int P=sc.nextInt();
        for(int i=1;i<P;i++){
            for(int j=1;j<=i;j++){
                System.out.print(conver(P,i)+"*"+conver(P,j)+"="+conver(P,i*j)+" ");
            }
            System.out.println();
        }
    }
    public static String conver(int P,int num){
        Stack<Integer> stack=new Stack<>();
        while(num!=0){
            stack.push(num%P);
            num/=P;
        }
        StringBuilder str= new StringBuilder();
        while(!stack.isEmpty()){
            if(stack.peek()>=10){
                str.append((char) ('A' + stack.pop() - 10));
            }else{
                str.append(String.valueOf(stack.pop()));
            }
        }
        str = new StringBuilder(str.toString());
        return str.toString();
    }
}